package com.mark.spring.annotation.auto.assembly.resource;

import com.mark.spring.annotation.value.Cookie;
import com.mark.spring.annotation.value.ValueBootstrap;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.util.Assert;

/**
 * @Description:
 * @Author: Mark
 * @CreateDate: 2019/9/22 22:43
 * @Version: 3.00.001
 * @Copyright : 豆浆油条个人非正式工作室
 */
@ComponentScan("com.mark.spring.annotation.auto.assembly.resource")
public class ResourceBootstrap {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(ResourceBootstrap.class);
        BookService bookService = applicationContext.getBean(BookService.class);
        BookDao bookDao  = applicationContext.getBean(BookDao.class);
        Assert.notNull(bookService,"bookService bean为空");
        Assert.notNull(bookDao,"bookDao bean为空");
        System.out.println(bookService.bookDao);
        System.out.println(bookDao);

        applicationContext.close();
    }
}
